package com.dhsc.view.dao.impl.jyjk.zxyc;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.dhsc.domain.jkzx.zxjh.GlyfzVo;
import com.dhsc.domain.jkzx.zxjh.YcjkyzVo;
import com.dhsc.domain.jkzx.zxjh.YzszVo;
import com.dhsc.view.dao.jyjk.zxyc.IyzszDao;

/**
 * @author HP
 * @date 2023/9/13 10:34
 */
@Repository("yzszdao")
public class YzszDaoImpl implements IyzszDao {

	@Autowired
	private SqlSessionTemplate viewSqlSessionTemplate;

    @Override
    public List<YzszVo> selectzruleinfo(YzszVo y) {
        return viewSqlSessionTemplate.selectList("yzszmapper.selectzruleinfo",y);
    }

    @Override
    public List<YzszVo> selectFZDictionaryByParent(YzszVo y) {
        return viewSqlSessionTemplate.selectList("yzszmapper.selectFZDictionaryByParent",y);
    }

    @Override
    public List<GlyfzVo> selectZThresholdSet(GlyfzVo g) {
        return viewSqlSessionTemplate.selectList("yzszmapper.selectZThresholdSet",g);
    }

    @Override
    public int delZThresholdSet(GlyfzVo g) {
        return viewSqlSessionTemplate.delete("yzszmapper.delZThresholdSet",g);
    }

    @Override
    public int addZThresholdSet(GlyfzVo g) {
        return viewSqlSessionTemplate.insert("yzszmapper.addZThresholdSet",g);
    }

    @Override
    public List<Map<String, Object>> selectzthresholdByChildrenCode(Map<String, Object> map) {
        return viewSqlSessionTemplate.selectList("yzszmapper.selectzthresholdByChildrenCode",map);
    }

    @Override
    public int selectZRuleIdByName(Map<String, Object> map) {
        return viewSqlSessionTemplate.selectOne("yzszmapper.selectZRuleIdByName",map);
    }

    @Override
    public int addZthreshold(YcjkyzVo y) {
        return viewSqlSessionTemplate.insert("yzszmapper.addZthreshold",y);
    }

    @Override
    public int delZthreshold(YcjkyzVo y) {
        return viewSqlSessionTemplate.delete("yzszmapper.delZthreshold",y);
    }
}
